Skip to content

feat: add token allow list smart contract with tests #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Feb 3, 2025

Conversation

lumoswiz
Copy link
Owner

@lumoswiz lumoswiz commented Feb 3, 2025

Simple contract that maintains a list of allowed token addresses using Solady's enumerable sets.

Features:

  • Add/remove tokens individually or in batch
  • Check if token is allowed
  • Get full list of allowed tokens
  • Owner-only access control for modifications
  • Tests for core functionality and access control

Implements Ownable pattern for access control
Uses Solady's EnumerableSetLib for efficient set operations
Includes functions to add/remove single tokens and batches
Provides view functions to check allowlist status and get all tokens
Test single token addition
Test token not in allowlist
Test batch token addition
Add fixtures for Gnosis chain token addresses
Add token removal tests (single and batch)
Add authorization checks using non-owner account
Add populated_allowlist fixture
Fix token list comparison using sets
@lumoswiz lumoswiz marked this pull request as ready for review February 3, 2025 21:22
@lumoswiz lumoswiz merged commit 559ac48 into main Feb 3, 2025
1 check passed
@lumoswiz lumoswiz deleted the feat/token-allowlist branch February 3, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant